#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>


int uninitial;
int g_val=100;
int main(int argc, char *argv[], char *env[])
{
  char*std ="Hello Linux";

  printf("code addr:%p\n",main);
  printf("init global addr:%p\n",&g_val);
  printf("uninit global addr:%p\n",&uninitial);
  
  static int A=100; 
  int*d1=(int*)malloc(8);
  int*d2=(int*)malloc(8);
  int*d3=(int*)malloc(8);
  printf("heap addr:%p\n",d1);
  printf("heap addr:%p\n",d2);
  printf("heap addr:%p\n",d3);

  printf("static stack addr:%p\n",&A);
  printf("stack addr:%p\n",&d1);
  printf("stack addr:%p\n",&d2);
  printf("stack addr:%p\n",&d3);

    printf("read only string addr: %p\n", std);
  int i,j;
  for(i=0;i<argc;i++)
  {
      printf("argv[%d]: %p\n",i,argv[i]);
  }
   for(j=0; env[i]; i++)
   {
               printf("env[%d]: %p\n", i, env[i]);               
   }
  return 0;
}
